﻿using MediatR;
using S.PurchaseAndSales.Api.Application.Command.SheepSaleCommand;
using S.PurchaseAndSales.Infrastructure.Interface.SalesForm;

namespace S.PurchaseAndSales.Api.Application.CommandHandlers.SheepSaleHandler
{
    public class CustomBAddCommandHandler : IRequestHandler<CustomBAddCommand, bool>
    {
        private readonly ICustomerRepository customerRepository;

        public CustomBAddCommandHandler(ICustomerRepository customerRepository)
        {
            this.customerRepository = customerRepository;
        }
        /// <summary>
        /// 客户的批量添加
        /// </summary>
        /// <param name="request"></param>
        /// <param name="cancellationToken"></param>
        /// <returns></returns>
        public Task<bool> Handle(CustomBAddCommand request, CancellationToken cancellationToken)
        {
            return customerRepository.BAddCustom(request.customerInformationModels);
        }
    }
}
